home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 501-525 / disk_513 / dkbtrace / dkb212dc.lzh / 12to20.doc next >
Text File  |  1991-04-24  |  6KB  |  179 lines

  1. Data file conversion from DKB 1.2 to 2.0 guidelines:
  2.  
  3. The only MANDATORY conversion(s) will be to data files that contain CSG
  4. "DIFFERENCE" types.  The previous format required you to list the primary
  5. object last, with the previous entries "subtracted" from the last object.
  6. The new format requires the primary object to be specified first, then
  7. the other shapes to be subtracted follow.  This is more intuitive, and more
  8. like a subtraction equation.  Subtractions performed by "INVERT" 'ing various
  9. objects rather than specifically by the "DIFFERENCE" function are O.K. as is.
  10.  
  11. The Old Way:
  12.  
  13. OBJECT
  14.    DIFFERENCE
  15.       subtracted shape 1
  16.       subtracted shape 2
  17.       subtracted shape 3
  18.       subtracted shape 4
  19.       orignal starting shape
  20.    END_DIFFERENCE
  21. .
  22. .
  23. END_OBJECT
  24.  
  25.  
  26. The New Way:
  27.  
  28. OBJECT
  29.    DIFFERENCE
  30.       orignal starting shape
  31.       subtracted shape 1
  32.       subtracted shape 2
  33.       subtracted shape 3
  34.       subtracted shape 4
  35.    END_DIFFERENCE
  36. .
  37. .
  38. END_OBJECT
  39.  
  40.  
  41. Other changes not required, but HIGHLY recommended (for speed), are to replace
  42. the slower general QUADRIC types with the new primitive types SPHERE and
  43. PLANE, when possible.
  44.  
  45.  
  46.  
  47. SPHERES:
  48.  
  49. A "Sphere" QUADRIC is effectively "built" around the origin with a default
  50. size (radius) of 1.0.  SCALE functions will become the sphere's radius, while
  51. TRANSLATE functions will become the sphere's new "origin" or center.
  52.  
  53. NOTE:  This will only work for symmetrically scaled spheres (where all 3 SCALE
  54.        values are the same).  For oblate sphereoids, you will still need to
  55.        use the general QUADRIC type.  SPHERES cannot be "stretched" properly.
  56.  
  57. The simplest conversion is:
  58.  
  59. Old:  QUADRIC "Sphere" SCALE <10.0 10.0 10.0> END_QUADRIC
  60.  
  61. New:  SPHERE <0.0 0.0 0.0> 10.0 END_SPHERE
  62.  
  63. This will then generate a true sphere at the origin (<0.0 0.0 0.0>), and of
  64. the size indicated (10).  Any previous TRANSLATE or ROTATE (or even SCALE)
  65. commands will still work properly.  To not change any of the SCALE statements,
  66. etc. you should specify a radius of 1.0, then all object transformations will
  67. occur exactly as they did previously.
  68.  
  69. Another conversion you can make is to include any TRANSLATE statements into
  70. the "center" statement of the sphere.
  71.  
  72. Old:  QUADRIC "Sphere" TRANSLATE <3.0 10.0 5.0> END_QUADRIC
  73.  
  74. New:  SPHERE <3.0 10.0 5.0> 1.0 END_SPHERE
  75.  
  76. This will then generate a true sphere at the origin indicated, with the
  77. default radius of 1.0.  Any further previous TRANSLATE or ROTATE (or even
  78. SCALE) commands will work as expected.
  79.  
  80.  
  81.  
  82. PLANES:
  83.  
  84. A "Plane_xx" QUADRIC is effectively "built" at the origin, but extends in
  85. any two  of three dimensions (Plane_XY, Plane_XZ, etc).  You must determine
  86. the plane's orientation:  for easy figuring, the dimension NOT specified in
  87. the old name of the plane is the direction of the "UP" vector for the new
  88. PLANE primitive.  Translate values may be changed into the "how far up is UP"
  89. value for the PLANE primitive.
  90.  
  91. (For example, in an "Plane_XZ", the "Y" axis is the unspecifed axis)
  92.  
  93. Old:  QUADRIC "Plane_XZ" TRANSLATE <0.0 -5.0 0.0> END_QUADRIC
  94.  
  95. So, the "Y" axis becomes the "UP" vector, and the TRANSLATE gives us the "how
  96. far up is UP" parameter:
  97.  
  98. New:  PLANE <0.0 1.0 0.0> -5.0 END_PLANE
  99.           |        |
  100.  "UP" direction --         -- "How far up is UP?" 
  101.   on the Y axis
  102.  
  103. This will then generate a true plane in the direction(s) indicated, and trans-
  104. late it up (or down, in this example) along the "UP" vector.  Any previous
  105. TRANSLATE or ROTATE (or even SCALE) commands will work properly.  To not
  106. change any of the TRANSLATE, etc. statements, the "how far up" parameter
  107. should be 0.0 (make the plane on the "origin" of <0.0 0.0 0.0>), then any
  108. transformations will work as before.
  109.  
  110. NOTE:  PLANES, like their QUADRIC counterparts, extend out to infinity.  If
  111.        you desire a "clipped" plane (one of finite size) it is easiest to
  112.        define two TRIANGLE primitives, laid so their hypotenuse(s) are back
  113.        to back.
  114.  
  115.  
  116.  
  117. LIGHT SOURCES:
  118.  
  119. One important thing to remember when defining a LIGHT_SOURCE is this:  The
  120. center of the light source MUST be "TRANSLATED" to wherever you want the point
  121. source to be.  Simply specifying the "origin" of the sphere to be there DOES
  122. NOT WORK, although it seems as though is should.  Light sources being
  123. converted to SPHERE types from QUADRIC types should be defined about the
  124. <0.0 0.0 0.0> origin, with the appropriate radius taken from any SCALE
  125. statements, but MUST then be "TRANSLATE" 'ed to wherever you want the light
  126. to be.  Chances are, due to the fact that QUADRIC "Spheres" are generated
  127. centered about the <0.0 0.0 0.0> origin, there will already be the proper
  128. "TRANSLATE" statement there in the object's definition.
  129.  
  130. Old:
  131.  
  132. OBJECT
  133.     QUADRIC "Sphere" SCALE <2.0 2.0 2.0> END_QUADRIC
  134.     TRANSLATE <0.0 200.0 0.0>
  135.     LIGHT_SOURCE
  136.     .
  137.     .
  138. END_OBJECT
  139.  
  140. New:
  141.  
  142. OBJECT
  143.     SPHERE <0.0 0.0 0.0> 2.0 END_SPHERE
  144.     TRANSLATE <0.0 200.0 0.0>
  145.     LIGHT_SOURCE
  146.     .
  147.     .
  148. END_OBJECT
  149.  
  150.  
  151.  
  152. IMAGE QUALITY
  153.  
  154. A new added feature for speed of tracing is the Quality parameter:
  155.  
  156. Q1 = Basic object positions only, nothing but Ambient Light illumination.
  157. Q3 = All of the above, plus Diffuse Lighting of objects.
  158. Q5 = All of the above, plus Shadows from Light Sources and Highlights.
  159. Q7 = All of the above, plus Textures.
  160. Q9 = All of the above, plus Reflection, Refraction, and Transmittance.
  161.  
  162. The values in-between are reserved for future expansion.  Using a lower
  163. quality value is great for quick renderings just to see where the heck the
  164. various objects you have defined wind up.
  165.  
  166. One important thing to note about Quality:  If you have a textured object in
  167. your scene, you probably didn't give the basic object a COLOUR.  If you plan
  168. on rendering it with the "Quality" factor less than 7, you _MUST_ declare a
  169. COLOUR for the object in addition to the texture, if it is to be visible.
  170. This is so the ambient or diffuse light has some colour on the object to hit
  171. while the surface texture is turned off.  When you finally render with Quality
  172. of 7 or greater, the defined basic object colour will not be seen, but rather
  173. your intended texture.
  174.  
  175.  
  176.  
  177. Not too horrible, eh?  -  Enjoy the plethora of new features and increased
  178. SPEED of DKB 2.0 !
  179.